package cn.krui.project;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

import cn.krui.project.pub_sub.simpleshopsetting.SubThread_simpleshopsetting;

/**
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/4/8 16:37:48
 * simpleshopsetting 模块的订阅和发布
 */
@Configuration
public class PubSubConfig_simpleshopsetting {
    @Value("${spring.redis.host:127.0.0.1}")
    private String spring_redis_host;
    @Value("${spring.redis.port:6379}")
    private int spring_redis_port;
    @Value("${spring.redis.timeout:6000}")
    private int spring_redis_timeout;
    @Value("${spring.redis.password:}")
    private String spring_redis_password;

    @Bean
    @Scope
    public SubThread_simpleshopsetting subThread_simpleshopsetting() {
        SubThread_simpleshopsetting subThread = new SubThread_simpleshopsetting(spring_redis_host,spring_redis_port,spring_redis_timeout,spring_redis_password); // simpleshopsetting消息订阅者
        subThread.start();
        return subThread;
    }
}